<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        @keyframes animate{
            0%{
                transform:rotate(0deg);
            }
            100%{
                transform:rotate(360deg);
            }
        }
        div{
            width: 100px;
            height: 100px;
            background-color: red;
            margin:100px auto;
            animation: animate 2s linear infinite;
                     /*动画名字 时长 速度  是否无限循环*/
        }
        div:hover{
            animation-play-state: paused;  /*暂停动画*/
        }
    </style>
</head>
<body>
    <div>

    </div>
</body>
</html>